import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/facility_statistics_entity.dart';

FacilityStatisticsEntity $FacilityStatisticsEntityFromJson(Map<String, dynamic> json) {
  final FacilityStatisticsEntity facilityStatisticsEntity = FacilityStatisticsEntity();
  final int? change = jsonConvert.convert<int>(json['change']);
  if (change != null) {
    facilityStatisticsEntity.change = change;
  }
  final int? check = jsonConvert.convert<int>(json['check']);
  if (check != null) {
    facilityStatisticsEntity.check = check;
  }
  final int? isUsed = jsonConvert.convert<int>(json['isUsed']);
  if (isUsed != null) {
    facilityStatisticsEntity.isUsed = isUsed;
  }
  final int? normal = jsonConvert.convert<int>(json['normal']);
  if (normal != null) {
    facilityStatisticsEntity.normal = normal;
  }
  final int? scrap = jsonConvert.convert<int>(json['scrap']);
  if (scrap != null) {
    facilityStatisticsEntity.scrap = scrap;
  }
  final int? unUsed = jsonConvert.convert<int>(json['unUsed']);
  if (unUsed != null) {
    facilityStatisticsEntity.unUsed = unUsed;
  }
  return facilityStatisticsEntity;
}

Map<String, dynamic> $FacilityStatisticsEntityToJson(FacilityStatisticsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['change'] = entity.change;
  data['check'] = entity.check;
  data['isUsed'] = entity.isUsed;
  data['normal'] = entity.normal;
  data['scrap'] = entity.scrap;
  data['unUsed'] = entity.unUsed;
  return data;
}

extension FacilityStatisticsEntityExtension on FacilityStatisticsEntity {
  FacilityStatisticsEntity copyWith({
    int? change,
    int? check,
    int? isUsed,
    int? normal,
    int? scrap,
    int? unUsed,
  }) {
    return FacilityStatisticsEntity()
      ..change = change ?? this.change
      ..check = check ?? this.check
      ..isUsed = isUsed ?? this.isUsed
      ..normal = normal ?? this.normal
      ..scrap = scrap ?? this.scrap
      ..unUsed = unUsed ?? this.unUsed;
  }
}
